<div ng-controller="resourceCtrl">
	<!-- tab -->
	<ul class="nav nav-tabs">
		<li ng-repeat="tab in tabs" ng-class="active(tab)" ng-click="current(tab)"><a href="#">{{tab.name}}</a></li>
	</ul>
	<!-- /tab -->
	
	<!--  -->
	<div class="fade-animate" ng-include="ctab.url"></div>
	<!-- / -->
</div>

<script type="text/javascript">
'use strict'
var resourceCtrl = ['$scope', '$http', function($scope, $http) {
	// 初始化
	$scope.tabs = [
		{name: '单图文消息', url: '@{Resources.article}'},
		{name: '多图文消息', url: '@{Resources.article_multi}'},
		{name: '图片库', url: '@{Resources.image}'},
	];
	$scope.ctab = $scope.tabs[0];
	
	// 定义处理方法
	angular.extend($scope, {
		active: function(tab) {
			return (tab === $scope.ctab) ? 'active' : '';
		}, current: function(tab) {
			$scope.ctab = tab;
		}
	});
}];
</script>
